package com.itheima;

import com.itheima.config.SpringConfig;
import com.itheima.service.AccountService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


/**
 * 事务不是任何情况都回滚，
 * 非运行时异常想回滚要添加rollbackFor属性
 */
public class App {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext cx = new AnnotationConfigApplicationContext(SpringConfig.class);

        AccountService accountService = cx.getBean(AccountService.class);

        accountService.transfer("Tom","Jerry" ,100D);

    }
}
